package model

import "time"

type AccountsBlogUser struct {
	Id          int        `db:"id" json:"id"`
	Password    string     `db:"password" json:"password"`
	LastLogin   *time.Time `db:"last_login" json:"last_login"`
	IsSuperuser bool       `db:"is_superuser" json:"is_superuser"`
	Username    string     `db:"username" json:"username"`
	FirstName   string     `db:"first_name" json:"first_name"`
	LastName    string     `db:"last_name" json:"last_name"`
	Email       string     `db:"email" json:"email"`
	IsStaff     bool       `db:"is_staff" json:"is_staff"`
	IsActive    bool       `db:"is_active" json:"is_active"`
	DateJoined  time.Time  `db:"date_joined" json:"date_joined"`
	Nickname    string     `db:"nickname" json:"nickname"`
	CreatedTime time.Time  `db:"created_time" json:"created_time"`
	LastModTime *time.Time `db:"last_mod_time" json:"last_mod_time"`
	Source      string     `db:"source" json:"source"`
}

func (a AccountsBlogUser) TableName() string {
	return "accounts_bloguser"
}

type AuthGroup struct {
	Id   int    `db:"id" json:"id"`
	Name string `db:"name" json:"name"`
}

func (a AuthGroup) TableName() string {
	return "auth_group"
}

type AccountsBloguserGroups struct {
	Id         int `db:"id" json:"id"`
	BloguserId int `db:"bloguser_id" json:"bloguser_id"`
	GroupId    int `db:"group_id" json:"group_id"`
	Bloguser   int `db:"-" json:"bloguser"`
	Group      int `db:"-" json:"group"`
}

func (a AccountsBloguserGroups) TableName() string {
	return "accounts_bloguser_groups"
}

type AccountsBloguserUserPermissions struct {
	Id           int `db:"id" json:"id"`
	BloguserId   int `db:"bloguser_id" json:"bloguser_id"`
	PermissionId int `db:"permission_id" json:"permission_id"`
}

func (a AccountsBloguserUserPermissions) TableName() string {
	return "accounts_bloguser_user_permissions"
}
